<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Map类型的使用方法</title>
</head>
<body>
    <script>
        // 传统的对象的键名是字符串
        let obj = {
            1 : "aaa",
            "1" : "bbb"
        }
        console.log(obj);

        // map的键名可以是任何类型
        let map = new Map([['aaa','xiasnn'],[{},"xiaxia"],[function () {},'nanan']]);
        console.log(map);

        let map2 = new Map();
        map2.set(1,"xiaxia").set([],"xiasnn").set(function () {},'nanan');
        console.log(map2);
    </script>
</body>
</html>